﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeFile="Sms_Shenhe.aspx.cs"
    Inherits="Sms_Shenhe" ViewStateMode="Disabled" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>短 信 队 列 审 核 管 理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="/images/style.css" rel="Stylesheet" />
    <script language="javascript" type="text/javascript" src="/js/jiazai.js"></script>
    <script src="/js/introbox.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
    <script language="javascript" type="text/javascript" src="/js/jquery-easyui/jquery.easyui.min.js"></script>
    <script language="javascript" type="text/javascript" src="/js/pagefunction.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#checkall").click(

        function () {

            if (this.checked) {
                $("input[name='ids']").each(function () { this.checked = true; });
            } else {
                $("input[name='ids']").each(function () { this.checked = false; });
            }
        });
        });

        function jqchk(op) {  //jquery获取复选框值 

            var chk_value = [];
            $('input[name="ids"]:checked').each(function () {
                chk_value.push($(this).val());

            });
            //var op = encodeURIComponent($("#dplop").val());
            if (chk_value.length > 0) {
                window.location.href = 'sms_pshenhe.aspx?ids=' + chk_value + '&op=' + op + '&back=sms_shenhe.aspx' + location.search;
            }
            else {
                alert("请至少选择一项");
            }
        }   

    </script>
</head>
<body style="overflow-x: hidden">
    <form id="form1" runat="server">
    <div>
        <table width="100%" class="tableBorder" border='1' cellspacing="0" style="border-collapse: collapse;"
            bgcolor="#ffffff" bordercolor="#cccccc">
            <tr align="center" valign="middle">
                <th height="22" colspan="88">
                    短 信 队 列 审 核 管 理
                </th>
            </tr>
            <tr>
                <td>
                    操作
                </td>
                <td>
                    <input type="button" class="btn" value="刷新" onclick="Refresh()" />
                    <asp:Button runat="server" ID="btnexcel" Text="导出Excel" OnClick="btnexcel_Click"
                        CssClass="btn" />
                        &nbsp;&nbsp|&nbsp;&nbsp;过滤
                       <asp:TextBox runat="server" ID="txbsearch" Width="80px"></asp:TextBox> 
                      
                    &nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;查看
                    <asp:Button runat="server" ID="btnSfail" Text="发送失败" OnClick="btnSfail_Click" CssClass="btn" />
                    <asp:Button runat="server" ID="btnLnull" Text="未拉取" OnClick="btnLnull_Click" CssClass="btn" />
                    <asp:Button runat="server" ID="btnLno" Text="拉取失败" OnClick="btnLno_Click" CssClass="btn" />
                    <asp:Button runat="server" ID="btnSno" Text="等待审核" OnClick="btnSno_Click" CssClass="btn" />
                    &nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;
                    <input type='checkbox' id='checkall' name='checkall' />全选/取消
                    <input class="btn" type="button" onclick="{if(confirm('请确认操作?')){jqchk('sok');}return false;}"
                        value="审核通过" />
                    <input class="btn" type="button" onclick="{if(confirm('请确认操作?')){jqchk('sno');}return false;}"
                        value="审核不通过" />
                    <input class="btn" type="button" onclick="{if(confirm('请确认操作?')){jqchk('lok');}return false;}"
                        value="重新发送" />
                </td>
            </tr>
        </table>
        <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    <asp:GridView ID="gvList" runat="server" AllowPaging="false" CellPadding="2" AutoGenerateColumns="False"
                        GridLines="Both" EmptyDataText="没有数据" CssClass="tableBorder" Width="100%" PageSize="40"
                        ViewStateMode="Disabled">
                        <Columns>
                            <asp:TemplateField HeaderText="序号">
                                <ItemTemplate>
                                    <input type='checkbox' id='ids' name='ids' value='<%# Eval("Id") %>' /><%# Eval("Id") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="sendtime" HeaderText="到达时间" />
                            <asp:BoundField DataField="senderID" HeaderText="用户编码" Visible="false" />
                            <asp:TemplateField HeaderText="用户名">
                                <ItemTemplate>
                                    <%# FTchina.SMSServer.SMSServer.GetSenderNameByID(Eval("senderID").ToString()) %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="target" HeaderText="目标号码" />
                            <asp:BoundField DataField="scontent" HeaderText="发送内容" />
                            <asp:BoundField DataField="sendcount" HeaderText="发送次数" />
                            <asp:TemplateField HeaderText="发送结果">
                                <ItemTemplate>
                                    <%#(Eval("state").ToString() == "0") ? "<font color=red>失败</font>" : ""%>
                                    <%#(Eval("state").ToString() == "1") ? "<font color=green>成功</font>" : ""%>
                                    <%#(Eval("state").ToString() == "2") ? "<font color=blue>未发送</font>" : ""%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="statetime" HeaderText="发送时间" />
                            <asp:BoundField DataField="smsguid" HeaderText="短信批次编码" Visible="false" />
                            <asp:TemplateField HeaderText="通道情况">
                                <ItemTemplate>
                                    <%#(Eval("taskstate").ToString() == "0") ? "<font color=red>拉取失败</font>" : ""%>
                                    <%#(Eval("taskstate").ToString() == "1") ? "<font color=green>拉取成功</font>" : ""%>
                                    <%#(Eval("taskstate").ToString() == "2") ? "<font color=blue>未拉取</font>" : ""%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="审核结果">
                                <ItemTemplate>
                                    <%#(Eval("shenhe").ToString() == "0") ? "<font color=red>禁止</font>" : ""%>
                                    <%#(Eval("shenhe").ToString() == "1") ? "<font color=green>通过</font>" : ""%>
                                    <%#(Eval("shenhe").ToString() == "2") ? "<font color=blue>自动放行</font>" : ""%>
                                </ItemTemplate>
                            </asp:TemplateField>
                             <asp:BoundField DataField="lockguid" HeaderText="锁" />
                            <asp:TemplateField HeaderText="操作" Visible="false">
                                <ItemTemplate>
                                    <input class="btn" type="button" onclick="Go('sms_pshenhe.aspx?ids=<%#Eval("id") %>&op=sok&back=sms_shenhe.aspx')"
                                        value="审核通过" />
                                    <input class="btn" type="button" onclick="Go('sms_pshenhe.aspx?ids=<%#Eval("id") %>&op=sno&back=sms_shenhe.aspx')"
                                        value="审核不通过" />
                                    <input class="btn" type="button" onclick="Go('sms_pshenhe.aspx?ids=<%#Eval("id") %>&op=lok&back=sms_shenhe.aspx')"
                                        value="重新发送" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <PagerSettings Visible="False" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
        <asp:Literal runat="server" ID="litpager"></asp:Literal>
    </div>
    </form>
    <script language='javascript' type='text/javascript' src='/JS/tablecolor.js'></script>
    <script language='javascript'><!--
        TableColor('gvList', '#F1F8FE', '#FFFFFF', '#F8DC87', '#BCE774');
--></script>
</body>
</html>
